package com.buss.core.utils;

import java.util.ArrayList;

public class AutoArrayList extends ArrayList {

	private static final long serialVersionUID = 7377723048149715569L;
	private Class itemClass;
	
	public AutoArrayList(Class itemClass){
		this.itemClass = itemClass;
	}
	
	public Object get(int index){
		try{
			while(index >= size()){
				add(itemClass.newInstance());
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		return super.get(index);
	}
}
